<div class="main_box"> 
    <!--左栏开始-->
    
    <div id="mainContent_2"> 
            
      <!-- 条目begin -->
      <div id="gift-items">
        <div class="submenubg"></div>
        <div class="bar"></div>
        <div class="box">
          
<?php   	
           if($gifts)
           {
           		$printN = 1;
            	foreach( $gifts as $gift )
            	{
					 if( $printN % 3 == 1 ) 
					 {
?>
            			<div class="clear hack bdbottom">
<?php 
					 }
?>
			            <div class="gift">
			            	<a href="<?php echo edp_href_link(PAGENAME_GIFT_INFO, 'gid='.$gift['gift_id'] );?>">
			              <div class="iconbg"><img src="<?php echo EdpGetGiftCouponPicURL($gift['gift_picture']); ?>" width="80" height="81" /></div>
			              </a>
			              <h5><a href="<?php echo edp_href_link(PAGENAME_GIFT_INFO, 'gid='.$gift['gift_id'] );?>"><?php echo $gift['gift_name'];?></a></h5>
						<p>类型：
<?php
							if($gift['gift_win_rate'] != '1') 
							{
								echo '抽奖';
							}else{
								echo '兑换';
							}
?>
			              </p>
						  
						  
						<p>有效期：
<?php 
			              if(strpos( $gift['gift_type'], '1' )!== false)
			              {
			              	 echo EdpSubStr($gift['gift_begin_date'],0,10).'至'.EdpSubStr($gift['gift_end_date'],0,10);
			              }
			              else
			              {
			              	 echo '不限期';
			              }
?>
			              </p>
			              <p>剩余数目：
<?php 
            	  		  if(strpos( $gift['gift_type'], '2' )!== false)
			              {
			              	 echo $gift['gift_total_num'];
			              }
			              else
			              {
			              	 echo '不限量';
			              }
?>
						  </p>
			              <p>
			              	价格：<?php echo $gift['gift_per_price']; ?>个E币
			              </p>
			            </div>
	            
<?php 
		            if( $printN % 3 === 0 ) 
		            {
						echo '</div>';
		        	}
	         		$printN++;
				}
				if( $printN % 3 !== 1 )
				{
					echo '</div>';
				}
            }
            echo $page->getBar(); 
            echo '</div>';
?>           
        <div class="btm"></div>
      </div>
    </div>
    
    <div id="sidebar_right">
 <?php
 	LoadSubpage( $page_base, "notice" ); 
 ?>
      <div class="column bdbottom2" >
      <div class="btna solidbottom"><h4>热门优惠券</h4></div>
     
<?php 
      if($hotCoupons) 
      {
      		$i = 1;
      		foreach( $hotCoupons as $coupon ) 
      		{
      	
?>
      			<p><a <?php if( $i < 3 ) echo 'class="red"';?>  href="<?php echo edp_href_link(PAGENAME_COUPON_INFO, 'couponID='.$coupon['coupon_id']);?>"><?php echo $coupon['coupon_name'];?></a></p>
<?php 	
      			$i++;
      		}
      
      	}
?>
      
      </div>
      
	  <div class="column bdbottom2" >
      	<div class=" solidbottom">
        	<h4>最新兑换</h4></div>
<?php 		
			if($giftHistory) 
			{
       			foreach( $giftHistory as $history )
       			{
       	
?>
			      <p><a href="<?php echo edp_href_link(PAGENAME_USER_INFO, 'uid='.$history['user_id']);?>"><?php echo $history['nick']?></a>
			      <span class="blak">
<?php
				  if($history['gift_win_rate']== '1') 
				  {
				  	echo '兑换了';
				  }
				  else
				  {
				  	echo '抽中了';
				  }
?>

			      </span>
<?php
				if($history['gift_status']==1)
				{
?>
					<a href="<?php echo edp_href_link(PAGENAME_GIFT_INFO, 'gid='.$history['gift_id']);?>">
<?php
				} 
?>
			      
				<?php echo $history['gift_name'];?>
<?php
				 if($history['gift_status']==1)
				 {
?>
					</a>
<?php
				 }
?>
				。<span class="grey"><?php echo $history['timediff'];?>
						</span></p>
<?php 
       			}
   			}
?>
		</div>
    </div>